/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.qcoinpay;

import android.app.Activity;
import android.content.res.Configuration;
import android.text.Html;
import android.text.TextPaint;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

public final class al {
    private final String m = "ModuleQCion";
    public Activity a;
    n b;
    public bi c;
    public ap d;
    public LinearLayout e;
    EditText f;
    public ac g;
    public int h;
    public int i;
    private int n;
    public u j;
    public LinearLayout k;
    public LinearLayout l;
    private LinearLayout o;
    private LinearLayout p;
    private LinearLayout q;
    private RelativeLayout r;

    public al(Activity paramActivity, n paramn) {
        this.a = paramActivity;
        this.b = paramn;
        this.c = bi.a(paramActivity);
        this.g = new ac(this.a);
        (paramActivity = this).d = new ap(paramActivity, paramActivity.a);
        paramActivity.d.setBackgroundColor(-1);
        paramActivity.n = cz.a(paramActivity.a, 8.0F);
        paramn = cz.a((paramActivity = paramActivity).a, 54.0F);
        if (cy.a(paramActivity.a) > cy.b(paramActivity.a))
            ;
        paramActivity = (paramActivity = cy.b(paramActivity.a) - paramn) ? paramActivity : cy.a(paramActivity.a)
                - paramn;
    }

    public final void a(int paramInt) {
        Object localObject;
        if (paramInt == 0) {
            if (this.o == null) {
                this.o = new LinearLayout(this.a);
                this.o.setOrientation(1);
                this.f = new EditText(this.a);
                this.f.setPadding(this.i, this.i, this.i, this.i);
                this.f.setBackgroundDrawable(this.c.a("bg_edt.9.png"));
                this.f.setSingleLine();
                this.f.setTextSize(14.0F);
                this.f.setTextColor(-13421773);
                this.f.setHint(a.a(b.U));
                this.f.setInputType(129);
                (paramInt = new LinearLayout.LayoutParams(this.h, cz.a(this.a, 33.5F))).setMargins(0, this.n, 0, 0);
                this.o.addView(this.f, paramInt);
                this.r = new RelativeLayout(this.a);
                localObject = this.j;
                (paramInt = this).r.removeAllViews();
                TextView localTextView;
                (localTextView = new TextView(paramInt.a)).setTextSize(14.0F);
                localTextView.setTextColor(-15964161);
                localTextView.setText(a.a(b.ae));
                localTextView.setOnClickListener(new f(paramInt, localTextView, (u) localObject));
                RelativeLayout.LayoutParams localLayoutParams;
                (localLayoutParams = new RelativeLayout.LayoutParams(-2, -2)).addRule(11, -1);
                paramInt.r.addView(localTextView, localLayoutParams);
                if ((TextUtils.isEmpty(((u) localObject).m)) && (TextUtils.isEmpty(((u) localObject).n)))
                    localTextView.setVisibility(4);
                this.o.addView(this.r, new LinearLayout.LayoutParams(-1, -2));
                (localObject = new TextView(this.a)).setOnClickListener(new d(this, (TextView) localObject));
                this.c.a((View) localObject, "btn_nor.9.png", "btn_press.9.png", "btn_nor.9.png");
                ((TextView) localObject).setGravity(17);
                ((TextView) localObject).setTextColor(-1);
                ((TextView) localObject).setTextSize(16.0F);
                ((TextView) localObject).setText(a.a(b.O));
                (paramInt = new LinearLayout.LayoutParams(this.h, cz.a(this.a, 40.5F))).topMargin = this.n;
                this.o.addView((View) localObject, paramInt);
            }
            this.l.removeAllViews();
            this.l.addView(this.o);
            return;
        }
        if (paramInt == 2) {
            if (this.p == null) {
                this.p = new LinearLayout(this.a);
                this.p.setOrientation(1);
                (paramInt = new TextView(this.a)).setTextSize(16.0F);
                paramInt.setTextColor(-2555904);
                paramInt.setText(a.a(b.af));
                this.p.addView(paramInt);
                (localObject = new TextView(this.a)).setTextSize(12.0F);
                ((TextView) localObject).setTextColor(-7829368);
                ((TextView) localObject).setText(Html.fromHtml(a.a(b.ag) + "<font color='#396ec6'>pay.360.cn</font>"
                        + a.a(b.ah)));
                (paramInt = new LinearLayout.LayoutParams(this.h, cz.a(this.a, 40.5F))).topMargin = this.n;
                this.p.addView((View) localObject, paramInt);
            }
            this.l.removeAllViews();
            this.l.addView(this.p);
            return;
        }
        if (paramInt != 1)
            return;
        if (this.q == null) {
            this.q = new LinearLayout(this.a);
            this.q.setOrientation(1);
            (paramInt = new TextView(this.a)).setOnClickListener(new e(this, paramInt));
            this.c.a(paramInt, "btn_nor.9.png", "btn_press.9.png", "btn_nor.9.png");
            paramInt.setGravity(17);
            paramInt.setTextColor(-1);
            paramInt.setTextSize(16.0F);
            paramInt.setText(a.a(b.aj));
            (localObject = new LinearLayout.LayoutParams(this.h, cz.a(this.a, 40.5F))).topMargin = this.n;
            this.q.addView(paramInt, (ViewGroup.LayoutParams) localObject);
            (paramInt = new TextView(this.a)).setTextSize(12.0F);
            paramInt.setTextColor(-7829368);
            paramInt.setText(a.a(b.ai));
            this.q.addView(paramInt);
        }
        this.l.removeAllViews();
        this.l.addView(this.q);
    }

    public final void a(Configuration paramConfiguration) {
        if (this.e != null)
            this.e.removeAllViews();
        else
            this.e = new LinearLayout(this.a);
        String str1 = a.a(b.S) + this.j.d;
        TextView localTextView1;
        (localTextView1 = new TextView(this.a)).setSingleLine();
        localTextView1.setTextSize(12.0F);
        localTextView1.setTextColor(-13421773);
        localTextView1.setText(str1);
        String str2 = a.a(b.T) + this.j.j + a.a(b.ab);
        TextView localTextView2;
        (localTextView2 = new TextView(this.a)).setSingleLine();
        localTextView2.setTextSize(12.0F);
        localTextView2.setTextColor(-13421773);
        localTextView2.setText(str2);
        if (paramConfiguration.orientation == 2) {
            int i1 = cz.a((paramConfiguration = this).a, 54.0F);
            if (cy.a(paramConfiguration.a) < cy.b(paramConfiguration.a))
                paramConfiguration = cy.b(paramConfiguration.a) - i1;
            else
                paramConfiguration = cy.a(paramConfiguration.a) - i1;
        }
        else {
            paramConfiguration = this.h;
        }
        if (localTextView1.getPaint().measureText(str1) + localTextView2.getPaint().measureText(str2) >= paramConfiguration)
            this.e.setOrientation(1);
        else
            this.e.setOrientation(0);
        (paramConfiguration = new LinearLayout.LayoutParams(-2, -2)).rightMargin = 24;
        this.e.addView(localTextView1, paramConfiguration);
        this.e.addView(localTextView2);
    }

    public final void a() {
        this.g.setVisibility(4);
    }
}